package com.ad.common.entity;

import java.util.Date;
import java.util.Set;

import com.ad.advertiser.entity.Ads;
import com.ad.blogger.entity.WeiboAccounts;
import com.ad.common.utils.DateFormatUtil;

/**
 * User entity. @author MyEclipse Persistence Tools
 */

public class User  implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 2846677780699720972L;
	 private Integer id;
     private String username;
     private String password;
     private Date regTime;
     private Date lastLoginTime;
     private String lastIp;
     private Integer passed;
     private Integer rankId;
     private int locked;
     /**
      * 0广告主
      * 1微博主
      */
     private int userType;
     private UserInfo userInfo;
     private String rpassword;
     private Set<Ads> ads ;
     private Set<WeiboAccounts> weiboAccounts;
   

	/** default constructor */
    public User() {
   
    }

	/** minimal constructor */
    public User(String username, String password, Date regTime, int userType) {
        this.username = username;
        this.password = password;
        this.regTime = regTime;
        this.userType = userType;
    }


	/** full constructor */
    public User(String username, String password, Date regTime, Date lastLoginTime, String lastIp, int passed, Integer rankId, int locked, int userType) {
        this.username = username;
        this.password = password;
        this.regTime = regTime;
        this.lastLoginTime = lastLoginTime;
        this.lastIp = lastIp;
        this.passed = passed;
        this.rankId = rankId;
        this.locked = locked;
        this.userType = userType;
    }

  
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Date getRegTime() {
		return regTime;
	}

	public void setRegTime(Date regTime) {
		this.regTime = regTime;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public String getLastIp() {
		return lastIp;
	}

	public void setLastIp(String lastIp) {
		this.lastIp = lastIp;
	}

	public Integer getPassed() {
		return passed;
	}

	public void setPassed(Integer passed) {
		this.passed = passed;
	}

	public Integer getRankId() {
		return rankId;
	}

	public void setRankId(Integer rankId) {
		this.rankId = rankId;
	}

	public int getLocked() {
		return locked;
	}

	public void setLocked(int locked) {
		this.locked = locked;
	}

	public int getUserType() {
		return userType;
	}

	public void setUserType(int userType) {
		this.userType = userType;
	}

	public UserInfo getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
		this.userInfo.setUser(this);
	}

	public String getRpassword() {
		return rpassword;
	}

	public void setRpassword(String rpassword) {
		this.rpassword = rpassword;
	}

	public Set<Ads> getAds() {
		return ads;
	}

	public void setAds(Set<Ads> ads) {
		this.ads = ads;
	}

	public Set<WeiboAccounts> getWeiboAccounts() {
		return weiboAccounts;
	}

	public void setWeiboAccounts(Set<WeiboAccounts> weiboAccounts) {
		this.weiboAccounts = weiboAccounts;
	}

	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("<");
		sb.append("id="+getId());
		sb.append(",username="+getUsername());
		sb.append(",password="+getPassword());
		sb.append(",regTime,="+DateFormatUtil.formatDate(this.getRegTime()));
		sb.append(",lastLoginTime="+DateFormatUtil.formatDate(getLastLoginTime()));
		sb.append(",lastIp,="+getLastIp());
		sb.append(",passed,="+getPassed());
		sb.append(",rankId,="+getRankId());
		sb.append(",locked,="+getLocked());
		sb.append(",userType,="+getUserType());
		sb.append(",userInfo,="+getUserInfo());
		sb.append(">");
		return sb.toString();
	}


}